package Book;

import java.math.BigDecimal;

public class Book {
    private String name;
    private String author;
    private int category_id;
    private BigDecimal price;
    private boolean isBorrowed;

    public Book(String name, String author, BigDecimal price, int category_id) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.category_id = category_id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getCategory_id() {
        return category_id;
    }

    public void setCategory_id(int category_id) {
        this.category_id = category_id;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public boolean isBorrowed() {
        return isBorrowed;
    }

    public void setBorrowed(boolean borrowed) {
        isBorrowed = borrowed;
    }

    @Override
    public String toString() {
        return "book{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", categoty_id='" + category_id + '\'' +
                ", price=" + price +
                ((isBorrowed == true) ? "，已经借出" : "，未被借出") +
                '}';
    }
}
